﻿<UserControl
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:QA="clr-namespace:QA.Wpf;assembly=QA.Wpf"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
        mc:Ignorable="d" 
        x:Class="SQLSilver.DbBrowserView"        
        d:DesignHeight="900" d:DesignWidth="1440"
        >
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="40"/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="250"/>
            <ColumnDefinition Width="8"/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <QA:ucDbConnectionManagerView Grid.ColumnSpan="3" Margin="10,0,10,0" DataContext="{Binding DbConnectionManager}" />
        <QA:QATreeView 
			Grid.Row="1"
			x:Name="treeView" 
			Margin="10,10,0,10" 
			QAParent="{Binding DbMetaData}"
			SelectedObject="{Binding SelectedObject, Mode=OneWayToSource}"
            />

        <GridSplitter 
			Grid.Row="1"
			Grid.Column="1"
			HorizontalAlignment="Center"
			VerticalAlignment="Stretch"
			ShowsPreview="True"
			Width="5" Margin="3,0,0,-0.2" />
        <DataGrid 
			Grid.Row="1"
			Grid.Column="2" 
			Margin="0,10,10,10" 
			ItemsSource="{Binding SelectedTable}" Grid.ColumnSpan="2" SelectionUnit="CellOrRowHeader">
            <DataGrid.AlternatingRowBackground>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FF6C79A4" Offset="0"/>
                    <GradientStop Color="#FFD2DCFD" Offset="1"/>
                </LinearGradientBrush>
            </DataGrid.AlternatingRowBackground>
        </DataGrid>

    </Grid>
</UserControl>
